<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.kms.model.*" %>
<%@ page import="java.io.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String basePath2 = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/";
String filepath =request.getAttribute("dir")+"";
List<String> listnames = new ArrayList<String>();
java.io.File file = new java.io.File(filepath);
File[] files = file.listFiles();
for(File fi:files){
	if(fi.isFile()){
		listnames.add(fi.getName());
	}else if(fi.isDirectory()){
	}
}

%>

<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
   <title>MBean Inspector</title>
   <link rel="stylesheet" href="<%=basePath %>css/style_master.css" type="text/css">
   <meta http-equiv="cache-control" content="no-cache">
</head>
<body>

<table width="100%">
   </table><table>
      <tbody><tr>
         <td><img src="<%=basePath %>img/logo02.gif" alt="JBoss" align="left" border="0"></td>
         <td valign="middle"><h1>Files Onlinedown</h1></td>
      </tr><tr>
   </tr></tbody></table>
   <ul>
   <table>
      <tbody>
      <tr>
         <td><b>The main screen provides the user to download a backup file server.<b/></td>
      </tr>
   </tbody>
   </table>
</ul>
<table cellpadding="5">
   <tbody><tr>
      <td><a href="#">Refresh MBean View</a></td>
   </tr>
	</tbody>
</table>
<hr>
<h3>db backup Directory files noline down:</h3>

<form id="thisform" method="post" action="databasebackup" enctype="multipart/form-data">
	<table border="1" cellpadding="1" cellspacing="1">
		<tbody>
		<tr class="AttributesHeader">
			<th>No</th>
		    <th>Name</th>
		    <th>down</th>
		    <th>Description</th>
		</tr>

		<%
		for(int i=0;i<listnames.size();i++){
		%>
				<tr style="">
					<td><%=i %></td>
				    <td><%=listnames.get(i) %></td>
				    <td>
				    <a href="<%=basePath %>down?fileName=<%=listnames.get(i) %>" mce_href="down?fileName=<%=listnames.get(i) %> " >onlinedown</a>  
				    </td>
				    <td>&nbsp;</td>
				</tr>
		<%
		}
		%>
	</tbody>
	</table>
</form>
